#! /bin/bash
echo 1 > /proc/sys/net/ipv4/ip_forward

ipv=/sbin/ipvsadm

vip=192.168.152.131

rs1=192.168.152.129
rs2=192.168.152.133

ifconfig ens33:0 down
ifconfig ens33:0 $vip broadcast $vip netmask 255.255.255.0 up
route add -host $vip dev ens33:0

$ipv -C
$ipv -A -t $vip:80 -s rr
$ipv -a -t $vip:80 -r $rs1:80 -g
$ipv -a -t $vip:80 -r $rs2:80 -g
  
echo "Director-DR is running"

# 特点
# 1. vip 绑定在ens33:0上, 路由表中添加默认路由 VIP
